package com.openatc.agent.config;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.socket.server.standard.ServerEndpointExporter;

import javax.annotation.PostConstruct;

/**
 * @author laoxia
 * @Date 2021/7/28 10:16
 * @Describetion
 */
@Configuration
public class WebSocketConfig {

    public static boolean TOKEN_VERIFY_FLAG;

    @Value("${agent.server.ws.verify:true}")
    private boolean verifyToken;

    @PostConstruct
    public void init() {
        TOKEN_VERIFY_FLAG = verifyToken;
    }

    @Bean
    public ServerEndpointExporter endpointExporter() {
        return new ServerEndpointExporter();
    }

}
